#pragma warning(disable: 4005)
/******************************************************************************/
/*! Win32Main.cpp
    [2012]
    \file		Win32Main.cpp
    \brief      entry point of the engine
*/
/******************************************************************************/
#include "NeroGame\Nero.h"
#include "Win32.h"

/*** Globals ******************************************************************/
extern Engine::NPlatform*	GPlatform;

/*** Defines ******************************************************************/
#define USE_RENDER_THREAD				0
#define MEMORY_MANAGERMENT_ENABLED		1
#define LUA								0

#if LUA
#pragma comment(lib, "lua51.lib")
#endif
/*** Platform Includes ********************************************************/
#include "Win32.h"
/*** Rendering Library ********************************************************/
#include "DirectX\Device.h"
/*** User Library *************************************************************/
#pragma comment(lib,"user32.lib") 

int WINAPI WinMain(HINSTANCE instance, HINSTANCE previousInstance, LPSTR commandLine, int showCommand)
{
	(void) instance;
	(void) previousInstance;
	(void) commandLine;
	(void) showCommand;

#ifdef MEMORY_MANAGERMENT_ENABLED
	Memory::MemoryManager::Initialize();
#endif

	GPlatform = MY_NEW(Memory::HID_Engine,"Platform Win32") System::Win32Platform(instance, previousInstance, commandLine, showCommand);
	
	Game::NGameEngine::Initialize();

#if USE_RENDER_THREAD
	StartRenderThread();
#endif

	Game::NGameEngine::Run();

	Game::NGameEngine::Deinitialize();
	
	MY_DELETE(GPlatform);

#if MEMORY_MANAGERMENT_ENABLED
	DUMP_MEMORY
	Memory::MemoryManager::Deinitialize();
#endif
}